package main

import (
	"fmt"
	"time"
)

func main() {
	handler()
}

func handler() {
	ch := make(chan string)
	go func() {
		time.Sleep(3 * time.Second)
		ch <- "job result"
	}()

	select {
	case result := <-ch:
		fmt.Println(result)
	case <-time.After(time.Second): // 命中该逻辑，channel无消费，内存泄漏
		return
	}
}
